package com.jingtai.platform.controller.merchants;

import com.jingtai.core.entity.merchants.MerchantsToMemberOrderDetail;
import com.jingtai.platform.service.merchants.MerchantsToMemberOrderDetailService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 商品订单详情表（用户对商户）
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/merchantstomemberorderdetail")
@Api(tags = "商品订单详情表（用户对商户）")
public class MerchantsToMemberOrderDetailController{

    @Autowired
    private MerchantsToMemberOrderDetailService merchantsToMemberOrderDetailService;


    @ApiOperation("商品订单详情表（用户对商户）列表查询")
    @GetMapping("/list")
    public ResultUtil aopMerchantsToMemberOrderDetailList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return merchantsToMemberOrderDetailService.MerchantsToMemberOrderDetaillist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询merchantsToMemberOrderDetail实体")
    @GetMapping("/getMerchantsToMemberOrderDetailById")
    public ResultUtil GetMerchantsToMemberOrderDetailById(@CApiParam(name = "id",value = "merchantsToMemberOrderDetail实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsToMemberOrderDetailService.getMerchantsToMemberOrderDetailById(id);
    }


    @ApiOperation("新增merchantsToMemberOrderDetail实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"merchantsToMemberOrderDetail.id","merchantsToMemberOrderDetail.createTime","merchantsToMemberOrderDetail.updateTime","merchantsToMemberOrderDetail.deleteFlag"})
    public ResultUtil aopAddMerchantsToMemberOrderDetail(@RequestBody @Validated MerchantsToMemberOrderDetail merchantsToMemberOrderDetail){
        return merchantsToMemberOrderDetailService.addMerchantsToMemberOrderDetail(merchantsToMemberOrderDetail);
    }

    @ApiOperation("编辑merchantsToMemberOrderDetail实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"merchantsToMemberOrderDetail.createTime","merchantsToMemberOrderDetail.updateTime","merchantsToMemberOrderDetail.deleteFlag"})
    public ResultUtil aopEditMerchantsToMemberOrderDetail(@RequestBody @Validated MerchantsToMemberOrderDetail merchantsToMemberOrderDetail){
        return merchantsToMemberOrderDetailService.editMerchantsToMemberOrderDetail(merchantsToMemberOrderDetail);
    }

    @ApiOperation("根据ID删除merchantsToMemberOrderDetail实体")
    @GetMapping("/delMerchantsToMemberOrderDetailById")
    public ResultUtil aopDelMerchantsToMemberOrderDetailById(@CApiParam(name = "id",value = "merchantsToMemberOrderDetail实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsToMemberOrderDetailService.delMerchantsToMemberOrderDetailById(id);
    }

}






